const { globalShortcut } = require("electron/main");

const handleGlobalShortcut = () => {
	return new Promise((resolve, reject) => {
		globalShortcut.register('Ctrl+K', (isRegister) => {
			if (isRegister) {
				resolve()
			} else {
				reject()
			}
		})
	})
}

const handleUnregisterAll = () => {
	return globalShortcut.unregisterAll()
}

module.exports = {
    handleGlobalShortcut,
	handleUnregisterAll
}